--TEST--
CTPP Plain resources (OO-style)
--FILE--
<?php
	error_reporting(E_ERROR);

	ini_set("ctpp.arg_stack_size",       "10240");
	ini_set("ctpp.code_stack_size",      "10240");
	ini_set("ctpp.steps_limit",          "10240");
	ini_set("ctpp.cache_bytecode",       "0");
	ini_set("ctpp.max_functions",        "1024");

	if (copy("7.ct2", "7-temp.ct2")) { echo "copy: OK\n"; }
	else
	{
		echo "copy: ERROR\n";
		exit();
	}

	// Create new class
	$T = new ctpp();

	$template = $T -> load_bytecode("7-temp.ct2");
	// Load bytecode
	if (is_resource($template)) { echo "load_bytecode: OK\n";    }
	else                        { echo "load_bytecode: ERROR\n"; }

	if ($T -> free_bytecode($template)) { echo "free_bytecode: OK\n";    }
	else                                { echo "free_bytecode: ERROR\n"; }

	if ($T -> free_bytecode($template)) { echo "free_bytecode: OK\n";    }
	else                                { echo "free_bytecode: ERROR\n"; }

	if (unlink("7-temp.ct2")) { echo "unlink: OK\n"; }
	else
	{
		echo "unlink: ERROR\n";
		exit();
	}

	$template = $T -> load_bytecode("7-temp.ct2");
	// Load bytecode
	if (is_resource($template)) { echo "load_bytecode: OK\n";    }
	else                        { echo "load_bytecode: ERROR\n"; }

	$template = $T -> load_bytecode("7-temp.ct2");
	// Load bytecode
	if (is_resource($template)) { echo "load_bytecode: OK\n";    }
	else                        { echo "load_bytecode: ERROR\n"; }

	$template1 = $T -> load_bytecode("7-temp.ct2");
	// Load bytecode
	if (is_resource($template)) { echo "load_bytecode: OK\n";    }
	else                        { echo "load_bytecode: ERROR\n"; }

	if ($T -> free_bytecode($template)) { echo "free_bytecode: OK\n";    }
	else                                { echo "free_bytecode: ERROR\n"; }

	if ($T -> free_bytecode($template1)) { echo "free_bytecode: OK\n";    }
	else                                 { echo "free_bytecode: ERROR\n"; }

	if ($T -> free_bytecode($template1)) { echo "free_bytecode: OK\n";    }
	else                                 { echo "free_bytecode: ERROR\n"; }

	$template = $T -> load_bytecode("7-temp.ct2");
	// Load bytecode
	if (is_resource($template)) { echo "load_bytecode: OK\n";    }
	else                        { echo "load_bytecode: ERROR\n"; }

	$template2 = $T -> load_bytecode("7-temp.ct2");
	// Load bytecode
	if (is_resource($template)) { echo "load_bytecode: OK\n";    }
	else                        { echo "load_bytecode: ERROR\n"; }

?>
--EXPECT--
copy: OK
load_bytecode: OK
free_bytecode: OK
free_bytecode: ERROR
unlink: OK
load_bytecode: ERROR
load_bytecode: ERROR
load_bytecode: ERROR
free_bytecode: ERROR
free_bytecode: ERROR
free_bytecode: ERROR
load_bytecode: ERROR
load_bytecode: ERROR